from django.conf.urls.defaults import patterns, include, url
import os.path
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

site_media = os.path.join(
  os.path.dirname(__file__), 'site_media'
)

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'forfood.views.home', name='home'),
    # url(r'^forfood/', include('forfood.foo.urls')),
    url(r'^$', 'main.views.main_page', name='home'),
    url(r'^login/$', 'main.views.login_page'),
    #url(r'^login/$', 'django.contrib.auth.views.login', name='forfood-login'),
    url(r'^logout/$', 'main.views.logout_page'),
    url(r'^register/$', 'main.views.register_page'),
    url(r'^verify_email/(?P<uid>\d+)/(?P<code>.*)/$', 'customer.views.verify_email'),
    url(r'^menu/$', 'menu.views.menu_page', name='forfood_menu'),
    
    url(r'^order/$', 'order.views.orders_page', name='forfood_orders_page'),
    url(r'^create_order/$', 'order.views.create_order', name='forfood_ceate_order'),
    url(r'^order/(?P<oid>\d+)/$', 'order.views.order_page', name='forfood_order_page'),
    url(r'^order/(?P<oid>\d+)/change_status/$', 'order.views.change_order_status'),
    url(r'^order/(?P<oid>\d+)/undo_change_status/$', 'order.views.undo_change_order_status'),

    #url(r'^customer/(\d+)/$', 'customer.views.customer_page'),
    url(r'^customer/star/(?P<rid>\d+)/$', 'customer.views.customer_star_restaurant'),
    url(r'^restaurant/$', 'restaurant.views.restaurant_page'),
    url(r'^restaurant/(?P<uid>\d+)/$', 'restaurant.views.restaurant_page'),
    url(r'^restaurant_manage/$', 'restaurant.views.restaurant_manage_page'),
    url(r'^restaurant_manage/menu/$', 'restaurant.views.restaurant_manage_menu_page'),
    url(r'^restaurant_manage/order/$', 'restaurant.views.restaurant_manage_order_page'),
    url(r'^restaurant_manage/update/$', 'restaurant.views.restaurant_update'),
    url(r'^display_meta/$', 'restaurant.views.display_meta'),
    
    url(r'^address/get_province/$', 'address.views.get_province'),
    url(r'^address/get_city/(?P<pid>\d+)/$', 'address.views.get_city'),
    url(r'^address/get_zone/(?P<cid>\d+)/$', 'address.views.get_zone'),
    url(r'^address/get_zone_detail/(?P<zid>\d+)/$', 'address.views.get_zone_detail'),
    url(r'^address/submit/(?P<zdid>\d+)/(?P<more>\w+)/$', 'address.views.address_submit'),
    url(r'^administrator_comment/$', 'comment.views.administrator_comment_page'),

    #url(r'^customer/(\d+)/$', 'customer.views.customer_page'),

    
    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    url(r'^site_media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': site_media }),
)
